//
//  TYHNavgationBar.m
//  GKBB-iOS
//
//  Created by tanyuehong on 16/7/12.
//  Copyright © 2016年 xkw. All rights reserved.
//

#import "TYHNavgationBar.h"

@interface TYHNavgationBar  ()



@end

@implementation TYHNavgationBar

- (instancetype)init
{
    CGFloat  statusHeigt = [UIApplication sharedApplication].statusBarFrame.size.height;
    self = [super initWithFrame:CGRectMake(0, 0, SCREENWIDTH, statusHeigt+NAVIGATION_HEIGHT)];
    if (self)
    {
        UINavigationItem  *navItem = [[UINavigationItem alloc] initWithTitle:@""];
        [self setItems:@[navItem]];
        _navItem = navItem;
        UIImage  *backImage = [UIImage imageNamed:@"ic_zsk_navigation"];
        UIEdgeInsets insets = UIEdgeInsetsMake(10, 10, 10, 10);
        backImage = [backImage resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch];
        [self setBackgroundImage:backImage forBarMetrics:UIBarMetricsDefault];
    }
    return  self;
}
- (void)setRightItem:(NSString *)rightItem
{
    UIBarButtonItem  *rigtItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:rightItem] style:UIBarButtonItemStylePlain target:self action:@selector(rightBarButtonItemClick)];
    rigtItem.imageInsets = UIEdgeInsetsMake(4, 4, 4, 4);
    self.navItem.rightBarButtonItem = rigtItem;
}
- (void)rightBarButtonItemClick
{
    
}
@end
